﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace game
{
    /// <summary>
    /// Main game class.
    /// </summary>
    public class Game : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        lumo.LumoComponent LumoComponent;

        public Game()
        {
            LumoComponent = new lumo.LumoComponent(this);
            LumoComponent.Scene = new game.scene.SceneIntro();

            this.Components.Add(LumoComponent);

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth  = (int)Global.ScreenSize.X;
            graphics.PreferredBackBufferHeight = (int)Global.ScreenSize.Y;
            graphics.IsFullScreen              = false;

            Content.RootDirectory = "Content";
        }

        protected override void Initialize()
        {
            base.Initialize();
            Global.Initialize(LumoComponent);
        }

        protected override void LoadContent()
        {
        }

        protected override void UnloadContent()
        {
        }

        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            Global.Update(LumoComponent);
        }

        protected override bool BeginDraw()
        {
            if (LumoComponent.SkipFrame)
                return false;
            else
                return base.BeginDraw();
        }

        protected override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }

    }
}
